<template>
  <div class="q-pa-md">
    <div class="q-gutter-y-md column" style="max-width: 300px">
      <t-field
        color="orange"
        filled
        v-model="text"
        label="Label"
        stack-label
        clearable
      >
        <template v-slot:control>
          <div class="self-center full-width no-outline" tabindex="0"
            >Text is <q>{{ text === null ? 'null' : text }}</q></div
          >
        </template>
        <template v-if="text === null" v-slot:append>
          <t-icon
            name="short_text"
            @click.stop.prevent="text = 'Some text'"
            class="cursor-pointer"
          />
        </template>
      </t-field>
    </div>
  </div>
</template>

<script>
  import { ref } from 'vue';

  export default {
    setup() {
      return {
        text: ref('Some text'),
      };
    },
  };
</script>
